package com.ruoyi.basicdata.feign.fallbackFactory;

import com.ruoyi.basicdata.feign.MissionFeign;
import com.ruoyi.common.core.web.domain.AjaxResult;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

@Component
public class MissFallback implements FallbackFactory<MissionFeign> {
    @Override
    public MissionFeign create(Throwable cause) {
        cause.printStackTrace();
        return new MissionFeign() {
            @Override
            public AjaxResult getMissNameByMissionId(Long id) {
                return AjaxResult.error("根据楼栋查任务名字的时候进熔断啦");
            }

            @Override
            public AjaxResult getMissNameByResidentId(Long residentId) {
                return AjaxResult.error("根据楼栋查任务id的时候进熔断啦");
            }
        };
    }
}
